<span class="glyphicon glyphicon-map-marker" aria-hidden="true" style="position: absolute; top: 27px; left: 45px;">
    <span>系统</span> /
    <span>资讯中心</span> /
    <span>编辑文章资讯</span>
</span>
<row>
    <div class="col-md-8 col-md-offset-2"  style="margin-top: 37px;margin-left: 5px;">
        <form class="form-horizontal" id="form">
            <input id="id" name="id" type="hidden" value="{$list.id}" />
            <div class="form-group">
                <label for="title" class="col-md-3 control-label">
                    <div class="text-center">文章资讯标题</div>
                </label>
                <div class="col-md-9">
                    <input type="text" class="form-control" id="title"
                           name="title" value="{$list.title}" placeholder="文章资讯标题">
                </div>
            </div>
            <div  class="form-group">
                <label for="news_type" class="col-md-3 control-label">
                    <div class="text-center">文章类型</div>
                </label>
                <div class="col-md-9">
                    <select class="form-control" id="news_type" name="news_type" >
                        <option value="0">请选择</option>
                        {volist name="news_type" id="vo"}
                        {if condition="$vo.id == $list.news_type"}
                        <option value="{$vo.id}" selected >{$vo.title}</option>
                        {else /}
                        <option value="{$vo.id}">{$vo.title}</option>
                        {/if}
                        {/volist}
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label for="author" class="col-md-3 control-label">
                    <div class="text-center">文章资讯作者</div>
                </label>
                <div class="col-md-9">
                    <input type="text" class="form-control" id="author"
                           name="author" value="{$list.author}" placeholder="文章资讯作者">
                </div>
            </div>
            <div class="form-group">
                <label for="logo" class="col-md-3 control-label">
                    <div class="text-center">文章资讯图片</div>
                </label>
                <div class="col-md-9">
                    <div class="layui-upload">
                        <button type="button" class="layui-btn" id="test1" style="background-color: #5bb75b;">上传图片</button>
                        <span style="color: #aaaaaa;">建议像素：350px*350px</span>
                        <br /><br />
                        {if condition="$list.UploadLogo"}
                        <input type="hidden" id="logo" name="logo" value="{$list.logo}" />
                        <div class="gs_cont_img" style="width: 100px; height: auto;">
                            <img src="__IMG__/{$list.UploadLogo.path}" id="image" width="100%" />
                        </div>
                        {else /}
                        <input type="hidden" id="logo" name="logo" value="0" />
                        <div class="gs_cont_img" style="width: 100px; height: auto;">
                            <img src="__IMG__/1.png" id="image" width="100%" />
                        </div>
                        {/if}
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label for="sort" class="col-md-3 control-label">
                    <div class="text-center">排序顺序</div>
                </label>
                <div class="col-md-9">
                    <input type="number" class="form-control" id="sort" name="sort"
                           step="1" min="0" value="{$list.sort}"  placeholder="排序顺序">
                </div>
            </div>
            <div class="form-group">
                <label for="brief" class="col-md-3 control-label">
                    <div class="text-center">简介</div>
                </label>
                <div class="col-md-9">
                    <textarea placeholder="简介" rows="5" class="form-control"
                              id="brief" name="brief"
                              style="overflow-x: hidden;resize:none">{$list.brief}</textarea>
                </div>
            </div>
            <div class="form-group">
                <label for="content" class="col-md-3 control-label">
                    <div class="text-center">
                        内容
                    </div>
                </label>
                <div class="col-md-9">
                    <script id="content" name="content" type="text/plain">{$list.content}</script>
                </div>
            </div>
            <div class="form-group save-btn" style="margin-top: 32px;">
                <a href="javascript:Edit()" class="ncap-btn-big ncap-btn-green"
                   style="background-color: #00a0e9;">提交</a>
                <a href="{:url('admin/News/index')}" class="ncap-btn-big ncap-btn-green"
                   style="background-color: #ff0055;">返回</a>
            </div>
        </form>
    </div>
</row>
<!-- 配置文件 -->
<script type="text/javascript" src="__STATIC__/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__STATIC__/ueditor/ueditor.all.js"></script>
<script type="text/javascript">
    var contents = UE.getEditor('content',{
        initialFrameWidth :700,//设置编辑器宽度
        initialFrameHeight:200,//设置编辑器高度
    });

    function Edit() {
        $.ajax({
            type:"post",
            url:"{:url('admin/news/Edit')}",
            data:$('#form').serialize(),
            dataType:'json',
            success:function (res) {
                title(res);
                if(res == "编辑成功"){
                    setTimeout("about()",1500);
                }
            }
        });
    }

    function about() {
        window.location.href = "{:url('admin/news/index')}";
    }

</script>